import java.util.Scanner;

public class MethodTest {
    public void myInput(int[] students){
        Scanner input = new Scanner(System.in);
        System.out.println("请输入第一个学生的成绩：");
        students[0] = input.nextInt();
        System.out.println("请输入第二个学生的成绩：");
        students[1] = input.nextInt();
        System.out.println("请输入第三个学生的成绩：");
        students[2]= input.nextInt();
        //students = new int[]{student1,student2,student3};
    }

    public double calcAvg(int[] students){

        int sum = calcSum(students);
        return sum*1.0/students.length;
    }

    public int calcSum(int[] students){
        int sum = 0;
        for (int student:students){
            sum+=student;
        }
        return sum;
    }

    public int calcMax(int[] students){
        int max=students[0];
        for (int i=1;i<students.length;i++){
            if (max < students[i]){
                max = students[i] ;
            }
        }
        return max ;
    }

    public static void main(String[] args) {
        int[] students = new int[3];
        MethodTest test = new MethodTest();
        test.myInput(students);
        double avg = test.calcAvg(students);
        System.out.println(avg);
        int sum=test.calcSum(students);
        System.out.println(sum);
        int max = test.calcMax(students);
        System.out.println(max);
    }
}
